import { ViewStyle } from 'react-native'
import { ReactElement } from 'react'

export interface OwlWaterfallProp {
  data: anyObj[]
  style?: ViewStyle
  pagination?: {
    size: number
    current: number
    total?: number
  }
  renderItem: owlWaterfallRenderItem
  onScrollBottom?: () => void
  onRefresh?: () => void
}
export interface FlatListData extends anyObj {
  _key: number
}
interface anyObj {
  [key: string | number]: any
}
export interface OwlWaterfallMethod {
  appendData: (data: anyObj[]) => void // 添加数据
  resetData: (data: anyObj[]) => void
}
export interface OwlWaterfallItemLayout {
  width: number
  height: number
}
export type owlWaterfallRenderItem = (
  item: FlatListData,
  onLayout: (params: OwlWaterfallItemLayout) => void,
) => ReactElement
